<?php
 include TEMPLATEPATH.'/incs/comment-process.php';
            	if(wp_verify_nonce($_POST['act_highlandtour_comment'],'act_highlandtour_comment'))
            	{
            		// nhận dữ liệu POST								
            		$error_ct = db_process_comment($_POST,$type);	
            	}	
            	else 
            	{
            		$_SESSION['contact'] = null;
            	}
            ?>	
<?php 
					global $wpdb;
					$request = "SELECT comment_ID,comment_post_ID,comment_content, comment_author, comment_author_email,comment_type,comment_date 
				    			FROM $wpdb->comments 
				    			WHERE $wpdb->comments.comment_approved=1
				    				AND $wpdb->comments.comment_type= '".$type_comment."'
				    				AND $wpdb->comments.comment_post_ID=".get_the_ID()." ORDER BY comment_ID DESC";				
				    
					$comments = $wpdb->get_results($request);
					$comment_cm = count($comments);									
					?>
					
					<div class="bgcomments"><!--begin comments-->
	                  <h2>Comment ( <?php echo $comment_cm;?> )</h2>
	                  <a href="#write_comment"><span class="write"></span></a>
	                  <div class="clear"></div>
	                  <?php
	                  if($comment_cm>0)
	                  { 
	                  ?>
	                	<ul>
	                		<?php
	                		foreach ($comments as $value) 
	                		{
	                		?>
	                			<li><!--begin li -->
	                				<!-- 
		                        	<img title="" alt="" src="images/comment_03.jpg">
		                        	-->
		                        	<?php echo get_avatar( $value->comment_author_email, 32 ); ?>
				                    <div class="textcomments">
					                	<p><strong>About</strong> <span class="namecomments"> <?php echo $value->comment_author;?>	</span>(<?php echo $value->comment_date;?>)</p>                      
				                        <p>
				                        <?php echo $value->comment_content;?>
				                        </p>
				                    </div><div class="clear"></div>                     			
		                        </li>
	                		<?php 	
	                		} 
	                		?>	                    	                        
	                        <!--end li -->                       
	                    </ul>
                    
                    <?php
	                  } 
                    #process comment
                    //print_r($_POST);
                   
                    include TEMPLATEPATH.'/comments/comments.php'; 
                    ?>
                    
                	
                   <div class="clear"></div>                 
                </div>